<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>添加老人健康信息</title>
		<style>

		</style>
		<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
	</head>

	<body>
		<article>
			<div class="span12">
				<ul class="breadcrumb">
					<li>
						<a href="#">主页</a> <span class="divider">/</span>
					</li>
					<li>
						<a href="elderhealth1.html">健康信息</a> <span class="divider">/</span>
					</li>
					<li class="active">
						<a href="elderhealthadd.html">新增</a> <span class="divider">/</span>
					</li>
				</ul>
			</div>
			</div>
			<div>
				<div class="row-fluid">
					<div class="span12">
						<form>
							<fieldset>
								<legend>增加老人健康信息</legend>
								<form @submit.prevent="register">
									<label>医生<input type="text" v-model="params.doctorId" /> </label><br />
									<label>老人<input type="text" v-model="params.elderId"/> </label><br />
									<label>检查事项<input type="text" v-model="params.content"/> </label><br />
									<label>身体状况<input type="text" v-model="params.bodyCondition" /> </label><br />
									<label>饮食建议<input type="text" v-model="params.elderDiet" /> </label><br />
									<label>检查时间<input type="date" v-model="params.checkTime"/></label><br />
									<button @click="register()" type="submit" class="btn" :disabled="actionBtnDisabled">提交</button>
									<a href="selectbykey.html" class="btn">取消</a>
								</form>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
		</article>
		<script src="http://code.jquery.com/jquery.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="../../common/axios.min.js"></script>
		<script src="../../common/vue.js"></script>
		<script type="text/javascript" src="js/yi.toast.js"></script>
		<script type="text/javascript" src="js/yi.shakeit.js"></script>
		<script>
			const vm = new Vue({
				el: "body>article",
				data: {
					params: {},
					resp: {
						message: null
					},
					actionBtnDisabled: false
				},
				methods: {
					"register": function() {
						this.actionBtnDisabled = true;
						axios.post("/elderhealth", this.params)
							.then(function(resp) {
								if(resp.code === "ok") {
									toast("老人健康添加成功");
									setTimeout(function() {
									}, 1500);
								} else {
									toast(resp.message);
								}
							}).finally(function() {
								vm.actionBtnDisabled = false;
							});
					}
				}
			});
		</script>
	</body>

</html>